import operation.ExitOperation;
import operation.IOperation;
import user.AdminUser;
import user.NorUser;
import user.User;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ${USER}
 * Date: ${YEAR}-${MONTH}-${DAY}
 * Time: ${TIME}
 */
public class Main {
    private static User login(){
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入姓名》");
        String name = scan.nextLine();
        System.out.println("请输入你的访问权限 1.管理员 2.普通用户");
        int choice = scan.nextInt();
        if(choice == 1){
            return new AdminUser(name);
        }else {
            return new NorUser(name);
        }
    }

    public static void main(String[] args) {
        User user = login();
        user.menu();

    }
}